export const schema = {
    type: "page",
    title: "团队修改",
    body: [
        {
            type: "button",
            actionType: "submit",
            label: "保存",
            icon: "fa fa-save pull-left",
            level: "primary",
            target: "teameditform",
            className: 'pull-right'
        },

        {
            type: "nav",
            stacked: false,
            links: [
                {
                    label: "查看",
                    to: "/team/view/${id}"
                },
                {
                    label: "编辑",
                    to: "/team/edit/${id}",
                    // acl: "team:edit",
                    visibleOn: 'acl.can("team:edit")',
                },
                {
                    label: "权限配置",
                    to: "/team/acl/${id}",
                    visibleOn: 'acl.can("team:setting")',
                    // acl: "team:setting"
                }
            ]
        },
        {
            type: "wrapper",
            className: "b-l b-b b-r bg-white no-padder",
            body: {
                title: "",
                className: "m-t-md",
                panelClassName: "no-border no-shadow m-b-none",
                api: "put:/api/team/${id}",
                initApi: "/api/team/${id}",
                redirect: "/team/list",
                submitText: "",
                name: "teameditform",
                type: "form",
                mode: "horizontal",
                actions: [
                    {
                        type: "button",
                        actionType: "submit",
                        label: "保存",
                        icon: "fa fa-save pull-left",
                        level: "primary"
                    }
                ],
                controls: [

                    {
                        type: "text",
                        name: "name",
                        label: "团队名称",
                        required: true
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "select",
                        name: "parent_id",
                        label: "上级团队",
                        clearable: true,
                        autoComplete: "/api/team/sug?term=${term}&org_id=${org_id}&id=${id}",
                        cache: false,
                        desc: '可不选，不选则则为顶级团队',
                        inline: true
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "select",
                        name: "type",
                        label: "团队类型",
                        required: true,
                        source: "/api/setting/team_type"
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "checkboxes",
                        columnsCount: 4,
                        name: "service_target",
                        label: "服务对象",
                        required: true,
                        source: "/api/setting/service_target"
                    },

                    {
                        type: "divider"
                    },

                    [
                        {
                            type: "text",
                            name: "contact_name",
                            label: "联系人",
                            required: true
                        },

                        {
                            type: "text",
                            name: "contact_phone",
                            label: "联系电话",
                            validations: 'isTelOrPhone',
                            required: true
                        }
                    ],

                    {
                        type: "divider"
                    },

                    {
                        type: "text",
                        name: "contact_email",
                        label: "邮箱",
                        validations: 'isEmail',
                        required: true
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "region",
                        name: "address",
                        label: "团队地址",
                        required: true
                    },

                    {
                        type: "divider"
                    },


                    {
                        type: "text",
                        name: "slogan",
                        label: "团队口号",
                        maxLength: 20
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "textarea",
                        name: "abstract",
                        label: "团队简介",
                        required: true
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "image",
                        name: "logo",
                        label: "Logo",
                        maxSize: 10 * 1024 * 1024,
                        // accept: "image/png,image/jpeg",
                        desc: '请选择 jpg 或者 png 图片，单个文件请不要超过 10M，建议尺寸比例：（60 x 60）。',
                        limit: {
                            minWidth: 60,
                            minHeight: 60,
                            maxwidth: 900,
                            maxHeight: 900
                        }
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "image",
                        name: "certificate_photo",
                        label: "上传资质",
                        // accept: "image/png,image/jpeg",
                        maxSize: 10 * 1024 * 1024,
                        desc: '上传资质文件做个说明，请选择 jpg 或者 png 图片，单个文件请不要超过 10M，最多可上传5张。建议尺寸比例：（750 x 440）。',
                        multiple: true,
                        maxLength: 5
                    },
                    {
                        type: "divider"
                    },

                    {
                        type: "image",
                        name: "team_photo",
                        // accept: "image/png,image/jpeg",
                        label: "上传团队照片",
                        maxSize: 10 * 1024 * 1024,
                        desc: '请选择 jpg 或者 png 图片，单个文件请不要超过 10M，最多可上传5张。建议尺寸比例：（750 x 440）。',
                        multiple: true,
                        maxLength: 5
                    },



                    {
                        type: "divider"
                    },

                    [
                        {
                            type: "text",
                            name: "username",
                            validations: 'isAlphanumeric,minLength:6',
                            label: "帐号"
                        },

                        {
                            type: "password",
                            name: "pwd",
                            validations: 'minLength:6',
                            label: "密码"
                        }
                    ]
                ]
            }
        }
    ]
};
